package com.nf.xiaomi.service.impl;

import com.nf.xiaomi.dao.CategoryDao;
import com.nf.xiaomi.dao.impl.CategoryDaoImpl;
import com.nf.xiaomi.entity.CategoryEntity;
import com.nf.xiaomi.service.CategoryService;

import java.util.List;

public class CategoryServiceImpl implements CategoryService {
    CategoryDao dao = new CategoryDaoImpl();

    public List<CategoryEntity> getAll() {
        return dao.getAll();
    }

    public int insert(String name) {
        return dao.insert(name);
    }

    public int update(Integer id, String name) {
        return dao.update(id,name);
    }

    public int delete(Integer id) {
        return dao.delete(id);
    }

    public int selectCidByName(String cname) {return dao.selectCidByName(cname);}
}